﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace LogManager.Config.View
{
    [ConfigurationCollection(typeof(ViewConfiguration), AddItemName = "view")]
    public class ViewCollection : ConfigurationElementCollection
    {
        public new ViewConfiguration this[string name]
        {
            get { return (ViewConfiguration)BaseGet(name); }
        }

        public ViewConfiguration this[int index]
        {
            get { return (ViewConfiguration)BaseGet(index); }
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((ViewConfiguration)element).Name;
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new ViewConfiguration();
        }

        public void Add(ViewConfiguration archive)
        {
            BaseAdd(archive);
        }

        public void Remove(ViewConfiguration archive)
        {
            BaseRemove(archive);
        }
    }
}
